/*
 * Copyright (c) 2018, apexes.net. All rights reserved.
 *
 *         http://www.apexes.net
 *
 */
package net.apexes.wsonrpc.demo.util;

import net.apexes.wsonrpc.core.WsonrpcLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author <a href=mailto:hedyn@foxmail.com>HeDYn</a>
 */
public class SimpleWsonrpcLogger implements WsonrpcLogger {

    private static final Logger LOG = LoggerFactory.getLogger(SimpleWsonrpcLogger.class);

    @Override
    public void onReceive(String sessionId, String json) {
        LOG.info("<< {}", json);
    }

    @Override
    public void onTransmit(String sessionId, String json) {
        LOG.info(">> {}", json);
    }

    @Override
    public void onError(String sessionId, Throwable error) {
        LOG.warn("", error);
    }
}
